﻿@if (Model.PageCount > 1)
{
    var links = Model.GetPageIndexs();
    var pager = "margin:3px;padding:3px;font:Verdana;font-size:14px;";
    var link = "text-decoration:none;font-size:14px;text-align:center;padding:2px 5px;border:#aaaadd 1px solid;margin:2px;text-decoration: none;color: #000099;";
    var span = "font-size:14px;text-align:center;padding:2px 5px;border:#eee 1px solid;margin:2px;color:#ddd;";
    var current = "background:#009;color:#fff;";
    <div class="aspnetpaging" style="@pager">
        @if (Model.HasPrev)
        {
            <a style="@link" href="@Model.GetPrevUrl()">@Model.Prev</a>
        }
        else
        {
            <span style="@span">@Model.Prev</span>
        }
        @if (Model.Page - 1 != 1 && !links.Any(o => o == 1))
        {
            <a style="@link" href="@Model.GetUrl(1)">1</a>
            <span>...</span>
        }
        @foreach (var item in links)
        {
            if (item == Model.Page)
            {
                <span style="@span@current" class="current" href="@Model.GetUrl(item)">@item</span>
            }
            else
            {
                <a style="@link" href="@Model.GetUrl(item)">@item</a>
            }
        }
        @if (Model.Page + 1 != Model.PageCount && !links.Any(o => o == Model.PageCount))
        {
            <span>...</span>
            <a style="@link" href="@Model.GetUrl(Model.PageCount)">@Model.PageCount</a>
        }
        @if (Model.HasNext)
        {
            <a style="@link" href="@Model.GetUrl(Model.PageCount)">@Model.Next</a>
        }
        else
        {
            <span style="@span">@Model.Next</span>
        }
    </div>
}